import { $get, $post, $put } from '@js/request'
import { ArbitratorSchema } from '@src/components/schema/arbitrator';
import { ParticipantSchema } from '@src/components/schema/videoCourt';

export async function getArbitratorsRequest (caseid: string): Promise<ArbitratorSchema[]> {
  const res = await $get(`/api/commission/case/${caseid}/arbitrator`)
  return res.data
}

export async function addPersonRequest (d: { [k: string]: any }): Promise<void> {
  const res = await $post('/api/commission/meetingParticipant', d)
  return res.data
}

export async function updatePersonRequest (id: string, d: { [k: string]: any }): Promise<void> {
  const res = await $put(`/api/commission/meetingParticipant/${id}`, d)
  return res.data
}

export async function uploadTemplateRequest (meetingid: string, fileid: string): Promise<void> {
  const res = await $put('/api/commission/meeting/uploadTemp', {
    meetingid, fileid
  })
  return res.data
}

export async function getParticipantListRequest (caseid: string): Promise<ParticipantSchema[]> {
  const res = await $get('/api/commission/participant', {
    caseid
  })
  return res.data
}
